
cmake_minimum_required(VERSION 2.8)

project(CrimsonCore)

set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CrimsonCore_BINARY_DIR}/bin)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CrimsonCore_BINARY_DIR}/bin)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CrimsonCore_BINARY_DIR}/bin)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CrimsonCore_BINARY_DIR}/bin)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CrimsonCore_BINARY_DIR}/bin)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CrimsonCore_BINARY_DIR}/bin)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CrimsonCore_BINARY_DIR}/bin)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CrimsonCore_BINARY_DIR}/bin)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CrimsonCore_BINARY_DIR}/bin)

if(WIN32)
	add_definitions(-DCC_WIN32)
else()
	add_definitions(-DCC_LINUX)
endif()

find_package(SDL)
find_package(OpenGL)
find_package(DevIL)
set(BULLET_ROOT $ENV{BULLET_ROOT})
find_package(Bullet)



find_package(Qt4)



if(QT4_FOUND)
	set(QT_USE_QTMAIN 1)
	set(QT_USE_QTOPENGL 1)
	set(QT_USE_QTXML 1)
	include(${QT_USE_FILE})
	include_directories(${QT_INCLUDE_DIR})
else()
	message("No Qt found\n")
endif()


include(${CrimsonCore_SOURCE_DIR}/scripts/FindGLEW.cmake)


include_directories(${CrimsonCore_SOURCE_DIR}/src/CrimsonEngine)
include_directories(${CrimsonCore_SOURCE_DIR}/src/CrimsonFileFormat)
include_directories(${CrimsonCore_SOURCE_DIR}/src/CrimsonMotion)
include_directories(${OPENGL_INCLUDE_DIR})
include_directories(${SDL_INCLUDE_DIR})
include_directories(${BULLET_INCLUDE_DIRS})

add_subdirectory(src)
add_subdirectory(samples)
#add_subdirectory(tools)

